<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>landingPage</title>
    <link href="css/jquery-ui.css" rel="stylesheet">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/init.css" rel="stylesheet">

    <style>
        html, body {
            height: 100%;
        }

        #main, .row {
            height: 100%;
            background: #d7d2e3;
        }

        .header {
            height: 50px;
            text-align: center;
        }

        #result {
            position: relative;
            background: #5bc0de;
        }

        #result .wapper {
            background: #ffffff;
            position: absolute;
            height: 736px;
            width: 414px;
            overflow: hidden;
        }

        #result .wapper * {
            position: absolute;
        }

        .select {
            z-index: 99;
            border: 1px dashed red;
            cursor: move;
        }

        .form-group {
            position: relative;
        }

        .unit {
            position: absolute;
            right: 40px;
            top: 28px;
            font-size: 20px;
        }

        .modal-body {
            background: #c3c3c3;
        }

        #preview-dailog {
            width: 414px;
            height: 736px;
            background: #fff;
            margin: 0 auto;
            position: relative;
        }
    </style>
</head>
<body>
<!-- 主盒子 -->
<div id="main" class="container">
    <div class="row header">
        <div class="col-md-6">
            <button class="btn btn-primary btn-lg btn-block" id="save">保存</button>
        </div>
        <div class="col-md-6">
            <button class="btn btn-primary btn-lg btn-block btn-info" id="preview">预览</button>
        </div>
    </div>
    <div class="row">

        <!-- 效果展示 -->
        <div class="col-md-6">
            <div id="result">
                <!-- 显示编辑效果 -->
                <div class="wapper"></div>
            </div>
        </div>

        <!-- 组件区 -->
        <div id="components" class="col-md-2">
            <div class="row">
                <!-- 背景 -->
                <button class="btn btn-default btn-lg btn-block" id="bg"
                        data='{"type":1,"componentType":"bg","name":"img"}'>背景
                </button>
                <div id="bg_option">
                    <button id="clean">清除</button>
                    <div class="file">
                        <input type="file" id="file" accept="image/*">
                    </div>
                </div>
            </div>
            <div class="row">
                <!-- 手机号输入框 -->
                <button class="btn btn-default btn-lg btn-block"
                        data='{"type":2,"componentType":"input","text":"输入手机号码","name":"phone"}'>手机号输入框
                </button>
            </div>
            <div class="row">
                <!-- 验证码输入框 -->
                <button class="btn btn-default btn-lg btn-block"
                        data='{"type":3,"componentType":"input","text":"输入验证码","name":"code"}'>验证码输入框
                </button>
            </div>
            <div class="row">
                <!-- 发送验证码按钮 -->
                <button class="btn btn-default btn-lg btn-block"
                        data='{"type":4,"componentType":"btn","text":"获取验证码","name":"codeSendBtn"}'>验证码发送按钮
                </button>
            </div>
            <div class="row">
                <!-- 提交按钮 -->
                <button class="btn btn-default btn-lg btn-block"
                        data='{"type":5,"componentType":"btn","text":"提交","name":"submitBtn","submit":true}'>提交按钮
                </button>
            </div>
        </div>

        <!-- 样式设置 -->
        <div id="styles" class="col-md-4" hidden>
            <form>
                <div class="form-group">
                    <label for="text">文本</label>
                    <input type="text" class="form-control" id="text" placeholder="输入框提示语">
                </div>
                <div class="form-group">
                    <label for="fontSize">字体大小</label>
                    <input type="number" class="form-control" id="fontSize">
                    <span class="unit">px</span>
                </div>
                <div class="form-group">
                    <label for="height">高度(百分比)</label>
                    <input type="number" class="form-control" id="height" max="100" min="0">
                    <span class="unit">%</span>
                </div>
                <div class="form-group">
                    <label for="width">宽度(百分比)</label>
                    <input type="number" class="form-control" id="width" max="100" min="0">
                    <span class="unit">%</span>
                </div>
                <div class="form-group">
                    <label for="left">x</label>
                    <input type="number" class="form-control" id="left" min="0">
                    <span class="unit">px</span>
                </div>
                <div class="form-group">
                    <label for="top">y</label>
                    <input type="number" class="form-control" id="top" min="0">
                    <span class="unit">px</span>
                </div>
                <div class="form-group">
                    <label for="color">颜色</label>
                    <input type="color" class="form-control" id="color">
                </div>
                <div class="form-group">
                    <label for="opacity">透明度</label>
                    <input type="number" class="form-control" id="opacity" max="1" min="0" step="0.05">
                </div>
                <div class="form-group">
                    <input type="button" class="form-control" value="删除该元素" id="delete">
                </div>
            </form>
        </div>
    </div>
</div>

<!--预览框-->
<div class="modal fade" id="dialog-wapper" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    预览
                </h4>
            </div>
            <div class="modal-body">
                <div id="preview-dailog">
                    123123123
                </div>
            </div>
        </div>
    </div>
</div>


</body>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdn.bootcss.com/dot/1.1.2/doT.min.js"></script>

<script src="js/utils.js"></script>
<script src="js/landingPage.js"></script>
</html>